<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProductsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('products', function (Blueprint $table) {
            $table->increments('id');
            $table->json('basic_info')->comment('基础信息');
            $table->string('apply_condition',1000)->comment('申请条件');
            $table->string('apply_material',1000)->comment('所需材料');
            $table->string('apply_tip',1000)->nullable()->comment('注意事项');
            $table->json('tag_ids')->nullable()->comment('标签合集');
            $table->tinyInteger('is_hot')->nullable()->comment('是否热门:0=>否,1=>是');
            $table->tinyInteger('status')->comment('状态:0=>下架中,1=>下架');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('products');
    }
}
